package com.tencent.ied.bk.common;

import com.tencent.ied.bk.entity.BaseAbstractInfo;
import com.tencent.ied.bk.entity.SearchAbstractInfo;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 本地内存存储 ，类似于数据库
 *
 * @author chen_yu
 * @date 2021/3/11 2:26
 */
public class LocalStore {
    /**
     * 倒排索引的存储
     * word->int[]<abstractId,count>
     */
    public static final Map<String, int[]> WORD_INDEX = new ConcurrentHashMap<>();
    /**
     * 摘要信息的集合
     */
    public static final List<BaseAbstractInfo> BASE_ABSTRACT_INFO_LIST = Collections.synchronizedList(new ArrayList<>());

    /**
     * 搜索关键词与摘要的映射
     */
    public static final Map<String, SearchAbstractInfo[]> SEARCH_KEY_ABSTRACT_MAPPING = new ConcurrentHashMap<>();

}
